package user;

public class User {
    private int id;
    private String username;
    private String password; // 实际存储时应加密
    private String email;    // 新增字段：邮箱
    private int age;         // 新增字段：年龄
    private String userType;

    // 无参构造函数
    public User() {}

    // 带 id, username, password, email 的构造函数
    public User(int id, String username, String password, String email, String usertype) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.email = email;
        this.userType = usertype;
    }

    // 带 username 和 password 的构造函数
    public User(String username, String password) {
        this.username = username;
        this.password = password;
    }

    // Getter 和 Setter 方法

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }
    public void setUserType(String userType) {
        this.userType = userType;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    // 新增：获取邮箱
    public String getEmail() {
        return email;
    }

    // 新增：设置邮箱
    public void setEmail(String email) {
        this.email = email;
    }

    // 新增：获取年龄
    public int getAge() {
        return age;
    }

    // 新增：设置年龄
    public void setAge(int age) {
        this.age = age;
    }

    public String getUserType() {
        return userType;
    }
}
